package Drawable;
import java.awt.*;
import java.lang.Object.*;

import javax.swing.*;

import FPGrowth.FPTree.FPTreeNode;

import java.awt.event.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.NoninvertibleTransformException;
import java.util.LinkedList;

public class Graph extends JFrame {
	FPTreeUI Tree ;
	final static int width = 40000;
	final static int height = 5000;
	class Canvas extends JPanel {
		public Canvas() {
			setSize(getPreferredSize());
			Canvas.this.setBackground(Color.white);
		}
		public Dimension getPreferredSize() {
			return new Dimension(width, height);
		}
		
		
		public void paintComponent(Graphics g) {
			super.paintComponent(g);
			Tree.paintFullTree(g);
			
		}
	}

	public Graph(FPTreeNode r) {
		super("GRAPH");
		Tree = new FPTreeUI(r);
		setExtendedState(Frame.MAXIMIZED_BOTH);  
		JScrollPane pane = new JScrollPane(new Canvas());
		getContentPane().add(pane);
	}

}